import 'package:go_router/go_router.dart';

import '../main.dart';
import '../page/home_page1.dart';

class MyRoute {
  static final GoRouter _router = GoRouter(
    routes: [
      GoRoute(
        path: '/',
        builder: (context, state) => const MyHomePage(),
      ),
      GoRoute(
        path: '/page1',
        builder: (context, state) {
          final data = state.extra as Map<String, dynamic>;
          return HomePage1(data: data['id']);
        },
      ),
    ],
  );


  static getRouter(){
    return _router;
  }
}